<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>在线反馈</title>
    <link href="/Public/css/ocss/animate.css" rel="stylesheet">
    <link rel="stylesheet" href="/Public/css/gxxjkefu-normalize.css">
    <link rel="stylesheet" href="/Public/css/toast.css">
    <link rel="stylesheet" href="/Public/css/model.css">
    <link rel="stylesheet" href="/Public/css/bootstrap-grid.min.css">
    <link rel="stylesheet" href="/Public/css/pager.css">
    <link rel="stylesheet" href="/Public/css/feedback.css">
    <link rel="stylesheet" href="/Public/css/index2.css">
    <link rel="stylesheet" href="/Public/css/common.css">
    <link rel="stylesheet" href="/Public/css/plugins/colorbox.css" />
    <link href="/Public/css/ocss/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/Public/css/ocss/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/css/ocss/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/Public/css/ocss/style.css?v=4.1.0" rel="stylesheet">
    <link href="/Public/Widget/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
    <style>

        body{
            font-size: 12px;
        }
        .user_image li {
            display: inline-block;
            margin: 0 15px;
            width: 10px;
        }

        .back_btn {
            width: 61px;
            height: 30px;
            position: absolute;
            right: 30px;
            top: 30px;
            border: none;
            background: url("/Public/image/back_btn.jpg") no-repeat center;
        }
    </style>
</head>
<body>
    <div class="scrollbar animated fadeInRight" id="style-1" style="overflow:scroll;overflow-x:hidden;">
        <div id="main_C" style="float: left;width: 99%">
            <div class="title_info">
                <span>在线反馈</span>
            </div>
            <div class="white_bgColor notice_info" style="width: 100%">
                <!-- 弹窗 -->
                <div id="myModal" class="modal">
                    <!-- 关闭按钮 -->
                    <span class="close" onclick="document.getElementById('myModal').style.display='none'">&times;</span>

                    <!-- 弹窗内容 -->
                    <img class="modal-content" id="img01">

                    <!-- 文本描述 -->
                    <div id="caption"></div>
                </div>
                <!--内容-->
                <div class="feedback_a_content">
                    <div class="feedback_content">
                        <div style="overflow: hidden;background: #f6f6f6">
                            <div class="content_left">
                                <span class="user_name" onclick="get_user()">
                                    <{$user_feedback.truename}>
                                        <img src="/Public/image/icon_phone.png" height="20" width="20" onclick="call_phone('<{$user_feedback.mobile}>')"/>
                                </span>
                                <span>
                                    <{$user_feedback.user_mobile}>
                                </span>
                            </div>
                            <div class="content_right">
                                <div class="content_question">
                                    <span>
                                        <{$user_feedback.ctime}>
                                    </span>
                                    <span>
                                        <{$user_feedback.content}>
                                    </span>
                                    <if condition="($has_img heq '1')">
                                        <ul class="user_image">
                                            <foreach name="feedback_image" item="img">
                                                <li>
                                                    <div class="project-people">
                                                        <a href="<{$img}>" class="img_link" data-rel="colorbox">
                                                            <img src="<{$img}>" height="142" width="196" />
                                                        </a>
                                                    </div>
                                                </li>
                                            </foreach>
                                        </ul>
                                    </if>
                                </div>
                                <div class="content_reply">
                                    <span>回复数
                                        <span class="red_color">(
                                            <{$user_feedback.back_num}>)</span>
                                    </span>
                                    <span>最后回复时间：
                                        <{$user_feedback.update_time}>
                                    </span>
                                    <input id="record_btn" type="button" value="回复" onclick="tab()" />
                                </div>
                                <div class="state_div">
                                    <img src="/Public/image/icon_end.png" height="15" width="15" />
                                    <span><{$user_feedback.s_status}></span>
                                    <span style="display: none">未回复</span>
                                    <span style="display: none">未完结</span>
                                    <span style="display: none">超时</span>
                                    <input onclick="javascrtpt:window.history.back(-1);" type="button" class="back_btn" />
                                </div>
                            </div>
                        </div>

                        <!--回复-->
                        <div id="record" style="display:none;clear: both">
                            <div class="reply_frame">
                                <div class="remark_div" style="clear: both">
                                    <p>回复</p>
                                    <textarea id="back_content" name="a" style="width:98%;height:210px;"></textarea>
                                    <div class="form-group" style="clear: both">
                                        <label class="col-sm-2 control-label" style="float: none">*上传图片</label>
                                        <div class="col-sm-10" style="float: none;width: 100%">
                                            <div class="uploader-list-container sc" style="min-height: 100px;">
                                                <div class="queueList">
                                                    <div id="dndArea" class="placeholder">
                                                        <div id="filePicker-2"></div>
                                                        <p>或将照片拖到这里，单次最多可选10张</p>
                                                    </div>
                                                </div>
                                                <div class="statusBar" style="display:none;">
                                                    <div class="progress">
                                                        <span class="text">0%</span>
                                                        <span class="percentage"></span>
                                                    </div>
                                                    <div class="info"></div>
                                                    <div class="btns">
                                                        <div id="filePicker2"></div>
                                                        <div class="uploadBtn">开始上传</div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div style="clear:both"></div>
                                    </div>
                                    <input type="button" id="click_sub" onclick="submit_back()" value="提交" />
                                </div>
                            </div>
                        </div>
                        <div class="history_reply" id="new_back">
                            <div class="history_reply_title">历史回复记录：</div>
                        </div>
                        <volist name="history_feedback" id="vo">
                            <if condition="($vo['vid'] heq '0')">
                                <ul style="margin-bottom: 30px">
                                    <li style="margin-bottom:20px;">客服：
                                        <span style="font-size: 16px;color: #31b0d5">
                                            <{$vo.admin_name}>(<{$vo.admin_id}>) </span><{$vo.ctime}>
                                        <if condition="$vo.my_feedback eq 1">
                                            <a href="javascript:;"  data-toggle="modal" data-target=".bs-example-modal-sm2" onclick="feedback_edit('<{$vo.id}>','<{$vo.content}>')"> 修改</a>
                                        </if>
                                    </li>
                                    <li style="color: black;text-indent:40px;">
                                        <{$vo.content}>
                                    </li>
                                </ul>
                                <ul class="user_image">
                                    <volist name="vo.img" id="vi" empty="">
                                        <li>
                                            <div style="display: block;margin-bottom: 10px;" class="project-people">
                                                <a href="<{$vi}>" class="img_link" data-rel="colorbox">
                                                    <img src="<{$vi}>" height="142" width="196" />
                                                </a>
                                            </div>
                                        </li>
                                    </volist>
                                </ul>
                                <else/>
                                <ul style="margin-bottom: 30px">
                                    <li style="margin-bottom:20px;">用户:
                                        <span style="font-size: 16px;  color: #d9534f">
                                            <{$vo.user_name}>
                                        </span>反馈 ：
                                        <{$vo.ctime}>
                                    </li>
                                    <li style="color: black;text-indent:40px;">
                                        <{$vo.content}>
                                    </li>
                                </ul>
                                <ul class="user_image">
                                    <volist name="vo.img" id="vi" empty="">
                                        <li>
                                            <div style="display: block;margin-bottom: 10px;" class="project-people">
                                                <a href="<{$vi}>" class="img_link" data-rel="colorbox">
                                                    <img src="<{$vi}>" height="142" width="196" />
                                                </a>
                                            </div>
                                        </li>
                                    </volist>
                                </ul>
                            </if>
                        </volist>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--//修改框-->
    <div class="modal fade bs-example-modal-sm2" style="background: none" tabindex="-1" role="dialog"
         aria-labelledby="mySmallModalLabel" id="div_mark">
        <div class="modal-dialog" role="document" id="content">
            <div class="modal-content">
                <textarea name="" id="content_mark" cols="63" rows="10" placeholder="请输入备注信息" style="margin: 10px"></textarea>
                <input type="button" style="padding: 2px 10px;background: #abdde6; margin: 0 10px 10px 0; color: white;  border: none;  border-radius: 10px;" value="确定" onclick="edit_sure()"/>
            </div>
        </div>
    </div>

    <script src="/Public/js/jquery-3.2.1.js"></script>
    <script src="/Public/js/bootstrap.min.js"></script>
    <script src="/Public/js/pager.js"></script>
    <script src="/Public/js/plugins/jquery.colorbox-min.js"></script>
    <script src="/Public/js/plugins/layer/layer.min.js"></script>
    <script src="/Public/js/toast.js"></script>
    <!-- 自定义js -->
    <script src="/Public/js/ojs/content.js?v=1.0.0"></script>
    <script type="text/javascript" src="/Public/Widget/webuploader/0.1.5/webuploader.min.js"></script>
    <script>
        //回复修改
        var id_f=0;
        function feedback_edit(id,content){
            id_f=id;
            console.log('9999',id+"0000"+content);
            $("#content_mark").val(content);
        }

        //确定修改
        function edit_sure() {
            var index = layer.load(1, {
                shade: [0.1, '#fff'] //0.1透明度的白色背景
            });

             var  content=  $("#content_mark").val();
             if(content==""){
                 layer.alert("不能为空！", {title: '提示框', icon: 3});
                 layer.close(index);
                 return false;
             }

            console.log('9999',id_f+"---0000"+content);
            layer.alert("确定回复？", {title: '提示框', icon: 3},function (index) {
                $.post("<{$SERVER_NAME}>/Feedback/edit_feedback",{id:id_f,content:content},function (data) {
                                        if(data.code='1001'){
                                            layer.alert("成功！", {title: '提示框', icon:1});
                                            window.location.reload();
                                        }else {
                                            layer.alert("失败！", {title: '提示框', icon:2});
                                        }

                });
                layer.close(index);
            });

            layer.close(index);

        }


        function get_user() {
            var phone="<{$user_feedback.mobile}>";
           window.parent.get_user(phone);
        }

        (function ($) {

            $(".permission-list dt input:checkbox").click(function () {
                $(this).closest("dl").find("dd input:checkbox").prop("checked", $(this).prop("checked"));
            });
            $(".permission-list2 dd input:checkbox").click(function () {
                var l = $(this).parent().parent().find("input:checked").length;
                var l2 = $(this).parents(".permission-list").find(".permission-list2 dd").find(
                    "input:checked").length;
                if ($(this).prop("checked")) {
                    $(this).closest("dl").find("dt input:checkbox").prop("checked", true);
                    $(this).parents(".permission-list").find("dt").first().find("input:checkbox").prop(
                        "checked", true);
                } else {
                    if (l == 0) {
                        $(this).closest("dl").find("dt input:checkbox").prop("checked", false);
                    }
                    if (l2 == 0) {
                        $(this).parents(".permission-list").find("dt").first().find("input:checkbox").prop(
                            "checked", false);
                    }
                }

            });

            //验证（具体的自己加，现在绑定的是所有input元素）

            $list = $("#fileList"), $btn = $("#btn-star"), state = "pending";
            // 当domReady的时候开始初始化
            $(function () {
                $("#record_btn").click(function () {
                    $("#record").fadeToggle(500);
                    $("#filePicker-2").find(".webuploader-pick").next().css({
                        'width': '168px',
                        'height': '44px',
                        'top': '20px'
                    })
                });
                var $wrap = $('.uploader-list-container'),

                    // 图片容器
                    $queue = $('<ul class="filelist"></ul>')
                    .appendTo($wrap.find('.queueList')),

                    // 状态栏，包括进度和控制按钮
                    $statusBar = $wrap.find('.statusBar'),

                    // 文件总体选择信息。
                    $info = $statusBar.find('.info'),

                    // 上传按钮
                    $upload = $wrap.find('.uploadBtn'),

                    // 没选择文件之前的内容。
                    $placeHolder = $wrap.find('.placeholder'),

                    $progress = $statusBar.find('.progress').hide(),

                    // 添加的文件数量
                    fileCount = 0,

                    // 添加的文件总大小
                    fileSize = 0,
                    // 优化retina, 在retina下这个值是2
                    ratio = window.devicePixelRatio || 1,

                    // 缩略图大小
                    thumbnailWidth = 110 * ratio,
                    thumbnailHeight = 110 * ratio,

                    // 可能有pedding, ready, uploading, confirm, done.
                    state = 'pedding',

                    // 所有文件的进度信息，key为file id
                    percentages = {},
                    // 判断浏览器是否支持图片的base64
                    isSupportBase64 = (function () {
                        var data = new Image();
                        var support = true;
                        data.onload = data.onerror = function () {
                            if (this.width != 1 || this.height != 1) {
                                support = false;
                            }
                        }
                        data.src =
                            "";
                        return support;
                    })(),

                    // 检测是否已经安装flash，检测flash的版本
                    flashVersion = (function () {
                        var version;

                        try {
                            version = navigator.plugins['Shockwave Flash'];
                            version = version.description;
                        } catch (ex) {
                            try {
                                version = new ActiveXObject('ShockwaveFlash.ShockwaveFlash')
                                    .GetVariable('$version');
                            } catch (ex2) {
                                version = '0.0';
                            }
                        }
                        version = version.match(/\d+/g);
                        return parseFloat(version[0] + '.' + version[1], 10);
                    })(),
                    supportTransition = (function () {
                        var s = document.createElement('p').style,
                            r = 'transition' in s ||
                            'WebkitTransition' in s ||
                            'MozTransition' in s ||
                            'msTransition' in s ||
                            'OTransition' in s;
                        s = null;
                        return r;
                    })(),

                    // WebUploader实例
                    uploader;

                if (!WebUploader.Uploader.support('flash') && WebUploader.browser.ie) {

                    // flash 安装了但是版本过低。
                    if (flashVersion) {
                        (function (container) {
                            window['expressinstallcallback'] = function (state) {
                                switch (state) {
                                    case 'Download.Cancelled':
                                        layer.msg('您取消了更新！', {
                                            icon: 5,
                                            time: 1000
                                        });

                                        break;

                                    case 'Download.Failed':
                                        layer.msg('安装失败！', {
                                            icon: 5,
                                            time: 1000
                                        });


                                        break;

                                    default:
                                        layer.msg('安装已成功，请刷新！', {
                                            icon: 6,
                                            time: 1000
                                        });

                                        break;
                                }
                                delete window['expressinstallcallback'];
                            };

                            var swf = 'expressInstall.swf';
                            // insert flash object
                            var html = '<object type="application/' +
                                'x-shockwave-flash" data="' + swf + '" ';

                            if (WebUploader.browser.ie) {
                                html += 'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ';
                            }

                            html += 'width="100%" height="100%" style="outline:0">' +
                                '<param name="movie" value="' + swf + '" />' +
                                '<param name="wmode" value="transparent" />' +
                                '<param name="allowscriptaccess" value="always" />' +
                                '</object>';

                            container.html(html);
                        })($wrap);

                        // 压根就没有安转。
                    } else {
                        $wrap.html(
                            '<a href="http://www.adobe.com/go/getflashplayer" target="_blank" border="0"><img alt="get flash player" src="http://www.adobe.com/macromedia/style_guide/images/160x41_Get_Flash_Player.jpg" /></a>'
                        );
                    }

                    return;
                } else if (!WebUploader.Uploader.support()) {
                    layer.msg('Web Uploader 不支持您的浏览器！', {
                        icon: 5,
                        time: 1000
                    });
                    return;
                }
                // 实例化
                uploader = WebUploader.create({
                    pick: {
                        id: '#filePicker-2',
                        label: '点击选择图片'
                    },
                    formData: {
                        uid: 123
                    },
                    dnd: '#dndArea',
                    paste: '#uploader',
                    swf: '/Public/Widget/webuploader/0.1.5/Uploader.swf',
                    chunked: false,
                    chunkSize: 512 * 1024,
                    server: '/Public/Widget/webuploader/0.1.5/server/fileupload2.php',
                    // runtimeOrder: 'flash',

                    accept: {
                        title: 'Images',
                        extensions: 'gif,jpg,png,jpeg', //,bmp,png
                        mimeTypes: 'image/*'
                    },

                    // 禁掉全局的拖拽功能。这样不会出现图片拖进页面的时候，把图片打开。
                    disableGlobalDnd: true,
                    fileNumLimit: 50,
                    fileSizeLimit: 1000 * 1024 * 1024, // 200 M
                    fileSingleSizeLimit: 250 * 1024 * 1024 // 50 M
                });

                // 拖拽时不接受 js, txt 文件。
                uploader.on('dndAccept', function (items) {
                    var denied = false,
                        len = items.length,
                        i = 0,
                        // 修改js类型
                        unAllowed = 'text/plain;application/javascript ';

                    for (; i < len; i++) {
                        // 如果在列表里面
                        if (~unAllowed.indexOf(items[i].type)) {
                            denied = true;
                            break;
                        }
                    }

                    return !denied;
                });

                uploader.on('dialogOpen', function () {
                    console.log('here');
                });


                // 添加“添加文件”的按钮，
                uploader.addButton({
                    id: '#filePicker2',
                    label: '继续添加'
                });

                uploader.on('ready', function () {
                    window.uploader = uploader;
                });

                // 当有文件添加进来时执行，负责view的创建
                function addFile(file) {
                    var $li = $('<li id="' + file.id + '">' +
                            '<p class="title">' + file.name + '</p>' +
                            '<p class="imgWrap"></p>' +
                            '<p class="progress"><span></span></p>' +
                            '</li>'),

                        $btns = $('<div class="file-panel">' +
                            '<span class="cancel">删除</span>' +
                            '<span class="rotateRight">向右旋转</span>' +
                            '<span class="rotateLeft">向左旋转</span></div>').appendTo($li),
                        $prgress = $li.find('p.progress span'),
                        $wrap = $li.find('p.imgWrap'),
                        $info = $('<p class="error"></p>'),

                        showError = function (code) {
                            switch (code) {
                                case 'exceed_size':
                                    text = '文件大小超出';
                                    break;

                                case 'interrupt':
                                    text = '上传暂停';
                                    break;

                                default:
                                    text = '上传失败，请重试';
                                    break;
                            }

                            $info.text(text).appendTo($li);
                        };

                    if (file.getStatus() === 'invalid') {
                        showError(file.statusText);
                    } else {
                        // @todo lazyload
                        $wrap.text('预览中');
                        uploader.makeThumb(file, function (error, src) {
                            var img;
                            if (error) {
                                $wrap.text('不能预览');
                                return;
                            }
                            if (isSupportBase64) {
                                img = $('<img src="' + src + '">');
                                $wrap.empty().append(img);
                            } else {
                                $.ajax(
                                    '/Public/Widget/webuploader/0.1.5/server/preview.php', {
                                        method: 'POST',
                                        data: src,
                                        dataType: 'json'
                                    }).done(function (response) {
                                    if (response.result) {
                                        img = $('<img src="' + response.result +
                                            '">');
                                        $wrap.empty().append(img);
                                    } else {
                                        $wrap.text("预览出错");
                                    }
                                });
                            }
                        }, thumbnailWidth, thumbnailHeight);

                        percentages[file.id] = [file.size, 0];
                        file.rotation = 0;
                    }

                    file.on('statuschange', function (cur, prev) {
                        if (prev === 'progress') {
                            $prgress.hide().width(0);
                        } else if (prev === 'queued') {
                            $li.off('mouseenter mouseleave');
                            $btns.remove();
                        }

                        // 成功
                        if (cur === 'error' || cur === 'invalid') {
                            console.log(file.statusText);
                            showError(file.statusText);
                            percentages[file.id][1] = 1;
                        } else if (cur === 'interrupt') {
                            showError('interrupt');
                        } else if (cur === 'queued') {
                            percentages[file.id][1] = 0;
                        } else if (cur === 'progress') {
                            $info.remove();
                            $prgress.css('display', 'block');
                        } else if (cur === 'complete') {
                            $li.children(".progress").remove();
                            $li.append('<span class="success"></span>');
                        }
                        $li.removeClass('state-' + prev).addClass('state-' + cur);
                    });

                    $li.on('mouseenter', function () {
                        $btns.stop().animate({
                            height: 30
                        });
                    });

                    $li.on('mouseleave', function () {
                        $btns.stop().animate({
                            height: 0
                        });
                    });

                    $btns.on('click', 'span', function () {
                        var index = $(this).index(),
                            deg;

                        switch (index) {
                            case 0:
                                uploader.removeFile(file);
                                return;

                            case 1:
                                file.rotation += 90;
                                break;

                            case 2:
                                file.rotation -= 90;
                                break;
                        }

                        if (supportTransition) {
                            deg = 'rotate(' + file.rotation + 'deg)';
                            $wrap.css({
                                '-webkit-transform': deg,
                                '-mos-transform': deg,
                                '-o-transform': deg,
                                'transform': deg
                            });
                        } else {
                            $wrap.css('filter',
                                'progid:DXImageTransform.Microsoft.BasicImage(rotation=' +
                                (~~(
                                    (file.rotation / 90) % 4 + 4) % 4) + ')');

                        }


                    });

                    $li.appendTo($queue);
                }

                // 负责view的销毁
                function removeFile(file) {
                    var $li = $('#' + file.id);

                    delete percentages[file.id];
                    updateTotalProgress();
                    $li.off().find('.file-panel').off().end().remove();
                }

                function updateTotalProgress() {
                    var loaded = 0,
                        total = 0,
                        spans = $progress.children(),
                        percent;

                    $.each(percentages, function (k, v) {
                        total += v[0];
                        loaded += v[0] * v[1];
                    });

                    percent = total ? loaded / total : 0;


                    spans.eq(0).text(Math.round(percent * 100) + '%');
                    spans.eq(1).css('width', Math.round(percent * 100) + '%');
                    updateStatus();
                }

                function updateStatus() {

                    var text = '',
                        stats;

                    if (state === 'ready') {
                        text = '选中' + fileCount + '张图片，共' +
                            WebUploader.formatSize(fileSize) + '。';
                    } else if (state === 'confirm') {
                        stats = uploader.getStats();
                        if (stats.uploadFailNum) {
                            text = '已成功上传' + stats.successNum + '张照片至XX相册，' +
                                stats.uploadFailNum +
                                '张照片上传失败，<a class="retry" href="#">重新上传</a>失败图片或<a class="ignore" href="#">忽略</a>'
                        }

                    } else {
                        stats = uploader.getStats();
                        text = '共' + fileCount + '张（' +
                            WebUploader.formatSize(fileSize) +
                            '），已上传' + stats.successNum + '张';

                        if (stats.uploadFailNum) {
                            text += '，失败' + stats.uploadFailNum + '张';
                        }
                    }

                    $info.html(text);
                }

                function setState(val) {
                    var file, stats;

                    if (val === state) {
                        return;
                    }

                    $upload.removeClass('state-' + state);
                    $upload.addClass('state-' + val);
                    state = val;

                    switch (state) {
                        case 'pedding':
                            $placeHolder.removeClass('element-invisible');
                            $queue.hide();
                            $statusBar.addClass('element-invisible');
                            uploader.refresh();
                            break;

                        case 'ready':
                            $placeHolder.addClass('element-invisible');
                            $('#filePicker2').removeClass('element-invisible');
                            $queue.show();
                            $statusBar.removeClass('element-invisible');
                            uploader.refresh();
                            break;

                        case 'uploading':
                            $('#filePicker2').addClass('element-invisible');
                            $progress.show();
                            $upload.text('暂停上传');
                            break;

                        case 'paused':
                            $progress.show();
                            $upload.text('继续上传');
                            break;

                        case 'confirm':
                            $progress.hide();
                            $('#filePicker2').removeClass('element-invisible');
                            $upload.text('开始上传');

                            stats = uploader.getStats();
                            if (stats.successNum && !stats.uploadFailNum) {
                                setState('finish');
                                return;
                            }
                            break;
                        case 'finish':
                            stats = uploader.getStats();
                            if (stats.successNum) {
                                layer.msg('上传成功！', {
                                    icon: 6,
                                    time: 1000
                                });


                            } else {
                                // 没有成功的图片，重设
                                state = 'done';
                                location.reload();
                            }
                            break;
                    }

                    updateStatus();
                }

                uploader.onUploadProgress = function (file, percentage) {
                    var $li = $('#' + file.id),
                        $percent = $li.find('.progress span');

                    $percent.css('width', percentage * 100 + '%');
                    percentages[file.id][1] = percentage;

                    updateTotalProgress();
                };

                uploader.onFileQueued = function (file) {
                    fileCount++;
                    fileSize += file.size;

                    if (fileCount === 1) {
                        $placeHolder.addClass('element-invisible');
                        $statusBar.show();
                    }

                    addFile(file);
                    setState('ready');
                    updateTotalProgress();
                };

                uploader.onFileDequeued = function (file) {
                    fileCount--;
                    fileSize -= file.size;

                    if (!fileCount) {
                        setState('pedding');
                    }

                    removeFile(file);
                    updateTotalProgress();

                };
                uploader.on('uploadSuccess', function (file, response) {
                    var obj = JSON.parse(response._raw); //由JSON字符串转换为JSON对象
                    var $li = $('#' + file.id);
                    $li.find(".title").html(obj.url);
                });
                uploader.on('all', function (type) {
                    var stats;
                    switch (type) {
                        case 'uploadFinished':
                            setState('confirm');
                            break;

                        case 'startUpload':
                            setState('uploading');
                            break;

                        case 'stopUpload':
                            setState('paused');
                            break;

                    }
                });

                uploader.onError = function (code) {
                    if (code == "F_DUPLICATE") {
                        layer.msg('文件重复！', {
                            icon: 5,
                            time: 1000
                        });


                    }

                };

                $upload.on('click', function () {
                    if ($(this).hasClass('disabled')) {
                        return false;
                    }

                    if (state === 'ready') {
                        uploader.upload();
                    } else if (state === 'paused') {
                        uploader.upload();
                    } else if (state === 'uploading') {
                        uploader.stop();
                    }
                });

                $info.on('click', '.retry', function () {
                    uploader.retry();
                });

                $info.on('click', '.ignore', function () {
                    alert('todo');
                });

                $upload.addClass('state-' + state);
                updateTotalProgress();
            });

        })(jQuery);
    </script>
    <script type="text/javascript">
        $(function () {
            $(".container a").hover(function () {
                $(this).append("<p id='pic'><img src='" + this.href + "' id='pic1'></p>");
                console.log('imageimageige:', this.href);
                $(".container a").mousemove(function (e) {
                    $("#pic").css({
                        "top": (e.pageY + 10) + "px",
                        "left": (e.pageX + 20) + "px"
                    }).fadeIn("fast");
                });
            }, function () {
                $("#pic").remove();
            });
        });
    </script>
    <script>
        var uf_id = "<{$uf_id}>";
        var image = '';
        function submit_back() {
            var content = $('#back_content').val();
            content=content.replace(/(\n)+|(\r\n)+/g,"");//去掉换行
            var url = "<{$SERVER_NAME}>/Feedback/admin_feedback";
            if (content == "" || content == null) {
                $('#style-1').toast({
                    content: '回复不能为空！',
                    duration: 1000
                });
                return false;
            }
            var picarray = new Array();
            var picobj = $(".state-complete");
            $.each(picobj, function (i, item) {
                picarray.push(picobj.eq(i).find(".title").html());
            });

            var pic_string = picarray.join("~"); //图片
            console.log('12321321', pic_string);
            $.post(url, {
                content: content,
                image: pic_string,
                uf_id: uf_id
            }, function (data) {

                if (data.code == '1001') {
                    window.location.reload();


                } else {
                    $('#style-1').toast({
                        content: data.result,
                        duration: 1000
                    });
                }
            });
        }

        jQuery(function ($) {
            colorbox_params = {
                reposition: true,
                scalePhotos: true,
                scrolling: false,
                previous: '<i class="fa fa-chevron-left"></i>',
                next: '<i class="fa fa-chevron-right"></i>',
                close: '&times;',
                current: '{current} of {total}',
                maxWidth: '100%',
                maxHeight: '90%',
                onOpen: function () {
                    document.body.style.overflow = 'hidden';
                },
                onClosed: function () {
                    document.body.style.overflow = 'auto';
                },
                onComplete: function () {
                    $.colorbox.resize();
                }
            };

            $('.Info_style [data-rel="colorbox"]').colorbox(colorbox_params);
            $('.project-people [data-rel="colorbox"]').colorbox(colorbox_params);
            $("#cboxLoadingGraphic").append("<i class='icon-spinner orange'></i>");
        });

        var vid = "<{$vid}>";
        console.log('0000', vid);

        /*点击回复，定位文本框*/
        function tab() {
            document.getElementById("back_content").focus();
        }

        //拨打电话给用户
        function call_phone(mobile) {


            console.log('momomo',mobile);
            var index = layer.load(1, {
                shade: [0.1, '#fff'] //0.1透明度的白色背景
            });
            var url = "<{$SERVER_NAME}>/AntiUser/call";
            if (mobile == "") {
//                layer.close(index);
                return false;
            }

            layer.alert("确认外呼", {title: '提示框', icon: 3}, function (index) {
                $.post(url, {phone: mobile}, function (data) {
                    console.log('1111111', data);
                    layer.close(index);
                });
                layer.close(index);
            });
            layer.close(index);
        }


        document.onkeydown = function (event) {
            var e = event || window.event || arguments.callee.caller.arguments[0];
            if (e && e.keyCode == 27) { // 按 Esc
                //要做的事情
            }

            if (e && e.keyCode == 113) { // 按 F2
                //要做的事情
            }

            if (e && e.keyCode == 13) { // enter 键
//                $('#click_sub').click();
                //要做的事情
            }
        };

    </script>

</body>

</html>